home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-11
/
vs_804.zip
/
MAINTSRC.EXE
/
D_DBF.PRG
< prev
next >
Wrap
Text File
|
1991-10-14
|
1KB
|
71 lines
* Filename......: D_Dbf.Prg
*
* Author........: Vernon E. Six, Jr.
*
* Last Update...: Mon 10-14-1991 10:03:25
*
* Notice........: Copyright (c) 1991 by Vernon E. Six, Jr.
* All Rights Reserved World Wide
*
* Dialect.......: Clipper v5.0x
#include "INKEY.CH"
#include "SETCURS.CH"
FUNCTION D_Dbf()
*****
* Delete currently selected DBF
*****
LOCAL n_Button
n_Button = VS_Alert( { PADC("Delete Current Database?",40), ;
PADC("Are You Sure?",40) }, { " No ", " Yes " }, 3 )
IF n_Button = 1
RETURN(NIL)
ENDIF
BEGIN SEQUENCE
*══ Lock the "one" side of the "one-to-many" ══════════════*
IF .NOT. _DICTHDR->( VS_RLock() )
BREAK
ENDIF
*══ Delete the index records ══════════════════════════════*
DO WHILE _DICTNTX->( dbSeek( _DICTHDR->DBF_NAME ) )
IF .NOT. _DICTNTX->( VS_DelRec() )
BREAK
ENDIF
ENDDO
*══ Delete the fields ═════════════════════════════════════*
DO WHILE _DICTFLD->( dbSeek( _DICTHDR->DBF_NAME ) )
IF .NOT. _DICTFLD->( VS_DelRec() )
BREAK
ENDIF
ENDDO
*══ Now delete the header record ══════════════════════════*
IF .NOT. _DICTHDR->( VS_DelRec() )
BREAK
ENDIF
END SEQUENCE
RETURN(NIL)
*** EOF: D_Dbf() ************************************************************